<?php
namespace app\admin\validate;

use think\Validate;

class Prisoners extends Validate
{
    protected $rule = [
        // 'username' => 'require|min:1|unique:user',
        // 'password' => 'require|min:6',
        // 'repassword' => 'require|confirm:password',
        // 'email' => 'email|unique:user',
        // 'moblie' => '/^1[34578]\d{9}$/|unique:user',
        // 'sex' => 'require|in:0,1',
        // 'status' => 'require|in:0,1',
        'number'=>'require',
        'name'=>'require',
        //'age'=>'require|between:1,120',
        'race'=>'require',
    ];

    protected $message = [
        // 'username.require' => '{%username_require}',
        // 'username.min' => '{%username_min}',
        // //'username' => '{%username_val}',
        // 'username.unique' => '{%username_unique}',
        // 'password' => '{%password_val}',
        // 'password.min' => '{%password_min}',
        // 'repassword' => '{%repassword_val}',
        // 'email' => '{%email_val}',
        // 'email.unique' => '{%email_unique}',
        // 'moblie' => '{%moblie_val}',
        // 'moblie.unique' => '{%moblie_unique}',
        // 'sex' => '{%sex_val}',
        // 'status' => '{%status_val}',
        
        'name.require'=>'{%name_unique}',
        //'age.require'=>'{%age_unique}',
        //'age.between'=>'{%age_between}',
        'race.require'=>'{%race_require}',
        'number.require'=>'{%number_require}',
    ];

    protected $scene = [
        'add'   => ['name', 'race','number'],
        'edit'  => ['name', 'race','number'],
        'password' => ['password', 'repassword'],
        'status' => ['status'],
    ];
}